<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="parentId">
        <p>111</p>
        <p class="test">222</p>
        <p>333</p>
        <p>444</p>
    </div>
    <script>
        const divObj = document.getElementById("parentId");
        console.log(divObj);

        // const test1 = document.getElementsByClassName("test")
        // console.log(test1);
        const test = divObj.getElementsByClassName("test");
        console.log(test);

        const testTarget = divObj.getElementsByClassName("test")[0];
        console.log(testTarget);
        console.log(testTarget.innerText);






    </script>
</body>

</html>